package com.playball.lottery.frm.yhzx;

import java.util.Timer;
import java.util.TimerTask;

import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.playball.lottery.R;
import com.playball.lottery.ApplicationData;
import com.playball.lottery.util.AbstractActivity;

/**
 * 支付订单提交
 * 
 * @ClassName: ShenzhoufuSuccessActivity
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author vanszhen
 * @date 2014年8月27日 上午9:54:00
 * 
 */
public class ShenzhoufuSuccessActivity extends AbstractActivity implements OnClickListener {

	/** 返回 */
	private TextView txtBack;
	/** 标题 */
	private TextView txtTitle;
	/** 账户 */
	private TextView txtAccout;

	/** 返回彩票 */
	private Button btnBackMain;
	
	/** 倒计时 */
	private TextView txtTime;
	
	
	private Timer timer = new Timer() ;
	
	//private int timeSecond = 1000;
	
	//private int reclen = 20 ;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		setContentView(R.layout.jdd_shenzhoufu_success);
		initView();
	//	timer.schedule(task, timeSecond, timeSecond);
	}

	private void initView() {

		txtBack = (TextView) findViewById(R.id.top_title_back);
		txtBack.setVisibility(View.GONE);
		txtBack.setOnClickListener(this);
		txtTitle = (TextView) findViewById(R.id.top_title_info);
		txtTitle.setText("手机卡充值");

		txtAccout = (TextView) findViewById(R.id.tv_account);
		txtAccout.setText(ApplicationData.getInstance().getUserName());

		btnBackMain = (Button) findViewById(R.id.btn_back);
		btnBackMain.setOnClickListener(this);
		
		txtTime = (TextView) findViewById(R.id.txt_time);
	}
	
	
	/*TimerTask task = new TimerTask() {
		
		@Override
		public void run() {
			runOnUiThread(new Runnable() {
				
				@Override
				public void run() {
					reclen -- ;
					txtTime.setText(Html.fromHtml( "系统<font color=#fe5052>" + reclen + "</font>" + "秒内将自动跳转返回彩票"));
					if (reclen <= 0 ) {
						timer.cancel();
						ShenzhoufuSuccessActivity.this.finish();
					}
					
				}
			});
		}
	};
	*/
	

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	//	timer.cancel();
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.top_title_back:
			ShenzhoufuSuccessActivity.this.finish();
			break;
		// 返回的首页
		case R.id.btn_back:
			ShenzhoufuSuccessActivity.this.finish();
			break;
		default:
			break;
		}

	}
}
